package org.example.config;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @description: TODO
* @author 杨镇宇
* @date 2024/7/29 16:44
* @version 1.0
*/


@Configuration
public class OpenApiConfig {

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("public-api")
                .pathsToMatch("/api/**")
                .build();
    }

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("ServiceA API Title")
                        .version("1.0")
                        .description("API documentation for your service")
                        .contact(new Contact().name("yangzhenyu").email("X217x07@qq.com").url("https://yangzhenyu.blog.csdn.net/?type=blog")));
    }
}
